1. Technical Field
The present invention relates to an image inspecting device that performs an appearance inspection using an image.
2. Related Art
An image inspecting device that performs an appearance inspection using an image is widely used for the purpose of automation and labor-saving of an inspection in a production line. There are various kinds and techniques of the appearance inspection. In a basic configuration of the appearance inspection, an image of an inspection object is taken with an image sensor (camera), a portion constituting an inspection area is extracted from the obtained image, and a feature of the image of the inspection area portion is analyzed and evaluated to perform an intended inspection (such as non-defective or defective determination, sorting, and information acquisition).
In this kind of image inspecting device, it is necessary to perform preparation work such as setting of the inspection area prior to inspection processing. A tool dedicated to the setting of the inspection area is prepared in a general device, and a user can properly set the inspection area according to an inspection object or an inspection purpose using the tool. However, the conventional tool has only a function of defining the inspection area using simple graphics such as a circle and a rectangle and a combination thereof. Accordingly, in the case that the inspection object has a complicated or special shape, sometimes the inspection area cannot correctly be matched with a contour of the inspection object. Even in the case that the contour of the inspection object can be expressed by the combination of the simple graphics, it takes a lot of time and workload to set the inspection area as the number of combined graphics increases. Nowadays there is a strong need to shorten arrangement time as much as possible for improvement of efficiency in multikind and small-quantity production. Therefore, it is undesirable to take a lot of trouble to set the inspection area. At the same time, in order to meet a complicated product shape and sophisticated and diversified inspection content, or in order to improve accuracy and reliability of the inspection, there is also a strong need to correctly set the inspection area only to a portion to be inspected.
Conventionally, an inspection area extracting technique in which binarization or color gamut extraction is used is well known as a technique of automatically setting the inspection area. In the inspection area extracting technique, a pixel group corresponding to a previously-set brightness range or color gamut is extracted from the image, and the pixel group is set to the inspection area. The inspection area extracting technique is effectively used in the case of a high brightness or color contrast between a portion (foreground) to be extracted as the inspection area and other portions (background). For example, the inspection area extracting technique is used in processing of extracting only an article portion from an image of an article conveyed on a belt conveyer.
A correct foreground portion is difficult to be solely extracted by the binarization or the color gamut extraction, when shade and shadow exist in the foreground portion to be extracted as the inspection area due to an influence of lighting, when the foreground portion is constructed with various kinds of brightness or colors, or when a color close to the foreground portion exists in the background. Nowadays, with the progress of the sophistication and diversification of the inspection content, frequently there is few color difference between the background and the foreground. The inspection directed only to one of cutting surfaces of a component having subjected to a forming-process and the inspection directed only to one of components mounted on a printed board can be cited as an example of few color difference between the background and the foreground. Because the binarization or the color gamut extraction is performed in each pixel of the image, the binarization or the color gamut extraction is easily influenced by a noise or a variation in lighting, and some pixel may be missing in the extracted inspection area or may be unnecessarily selected from the background like an enclave, which results in inspection accuracy being degraded.
Patent Document 1 discloses the inspection area setting methods such as a method for setting a position or a size of the inspection area from CAD data of an inspection object component and a method for recognizing an area to be inspected by taking a difference between two images taken before and after component mounting. Although the use of these inspection area setting methods can automatically set the inspection area, the inspection area setting methods lack versatility because application targets of the inspection area setting methods are restricted.
Patent Document
Patent Document 1: Japanese Unexamined Patent Publication No. 2006-58284
Non-Patent Document
Non-Patent Document 1: Y. Boykov and M.-P. Jolly: “Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in N-D images”, ICCV2001, 01, p. 105 (2001)